package com.yangj.web;

import java.util.List;
import java.util.Map;

import com.yangj.dao.AccompanyingPlayDetailDao;
import com.yangj.model.AccompanyingPlay;
import com.yangj.model.AccompanyingPlayDetail;

import net.sf.json.JSONArray;

public class GetAccompanyingPlayDetail  extends JsonServlet{
	private AccompanyingPlayDetailDao accPlayDetail = new AccompanyingPlayDetailDao();
	@Override
	public String dealInput(Map<String, String[]> input) {
		int id = 1;
		if(input.get("id") != null && input.get("id")[0].matches("\\d{1,9}")) {
			id = Integer.parseInt(input.get("id")[0]);
		}
		AccompanyingPlayDetail accompanyingPlayDetail = accPlayDetail.get(id);
		return JSONArray.fromObject(accompanyingPlayDetail).toString();
	}
}
